package com.hdax.dmw.order.controller;

import com.hdax.dmw.common.controllers.order.OrderControllerApi;
import com.hdax.dmw.entity.order.DmOrder;
import com.hdax.dmw.order.service.DmOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class OrderController implements OrderControllerApi {

    @Autowired
    private DmOrderService orderService;
    @Override
    public DmOrder detaile(String orderNo) {
        return orderService.detail(orderNo);
    }

    //将订单修改为已支付
    @Override
    public void update(String orderNo, String aliTradeNo) {
        DmOrder detail = orderService.detail(orderNo);
        detail.setOrderType(2);
        detail.setAliTradeNo(aliTradeNo);
        orderService.updateById(detail);
    }
}
